FROM hub.c.163.com/shndklfnsl333/codecobmbat:coco-base

MAINTAINER k9999

# Update Supervisor
RUN wget http://git.oschina.net/zk34456/docker-codecombat/raw/master/db/supervisord.conf -P /etc/supervisor/conf.d/ 

# Install MongoDB
RUN \
  apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 && \
  echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' \
    | tee /etc/apt/sources.list.d/mongodb.list && \
  apt-get update && \
  apt-get install -y -q mongodb-org && \
  mkdir -p /data/db

RUN wget http://git.oschina.net/zk34456/docker-codecombat/raw/master/db/restore.sh -P /root/
RUN /bin/bash /root/restore.sh
EXPOSE 27017
CMD ["/usr/bin/supervisord"]
